﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework.Graphics;

namespace AimGameLibrary.GameObject
{
    public class GameSpriteEffects : GameBaseValue
    {
        SpriteEffects myspriteeffects;

        public SpriteEffects MyspriteeffectS { get { return myspriteeffects; } set { myspriteeffects = value; } }

        public override void LoadData(Identification getdata, int IndexData, NodeData node)
        {
            if (getdata.Items.GetValue(IndexData + 1).GetType() == typeof(NodeInputMode))
                InputMode = (NodeInputMode)getdata.Items.GetValue(IndexData + 1);

            if (getdata.Items.GetValue(IndexData + 2).GetType() == typeof(SpriteEffects))
                myspriteeffects = (SpriteEffects)getdata.Items.GetValue(IndexData + 2);
        }

        protected override object GetParentValue()
        {
            if (this.Listparent.Count > 0)
            {
                if (InputMode == NodeInputMode.SpriteEffects_1
                    && Listparent[0].GetType() == typeof(GameSpriteEffects))
                {
                    GameSpriteEffects tempparent = (GameSpriteEffects)Listparent[0];
                    return tempparent.MyspriteeffectS;
                }
                else return myspriteeffects;
            }
            else return myspriteeffects;
        }

        protected override void SetParentValue(object obj)
        {
            if (this.Listparent.Count > 0)
            {
                if (InputMode == NodeInputMode.SpriteEffects_1)
                    if (Listparent[0].GetType() == typeof(GameSpriteEffects))
                    {
                        GameSpriteEffects tempparent = (GameSpriteEffects)Listparent[0];
                        tempparent.myspriteeffects = (SpriteEffects)obj;
                    }
            }
        }
    }
}
